<?php

// +----------------------------------------------------------------------
// | Apprh.Shop
// +----------------------------------------------------------------------
// | Copyright (c) 2017-2027 http://www.apprh.com All rights reserved.
// +----------------------------------------------------------------------
// | Notice: This code is not open source, it is strictly prohibited
// |         to distribute the copy, otherwise it will pursue its
// |         legal responsibility.
// +----------------------------------------------------------------------
// | Author: 雲溪荏苒 <290648237@qq.com>
// +----------------------------------------------------------------------

namespace app\frontend\controller;

use controller\HomeBase;


/**
 * 单页控制器
 * Class Paper
 * @package app\home\controller
 * @author 雲溪荏苒 <290648237@qq.com>
 * @date 2017/9/28
 */
class Article extends HomeBase
{


    public function show()
    {
        // 获取所有单页文章
        $articleList = D('article')->getArticleList();
        $this->assign('articleList', $articleList);
//        dump($articleList);die;
        $info = D('article')->getArticleDetailById(I('article_id'));
        $this->assign('info', $info);


        // SEO
        $this->assign('seo_title', $info['article_title'].' - '.sysconf('seo_title'));
        $this->assign('seo_keywords', sysconf('seo_keywords'));
        $this->assign('seo_description', sysconf('seo_description'));

        return $this->fetch('');
    }

    /**
     * 公司简介
     * @return mixed
     */
    public function about()
    {
        $this->assign('generator', request()->domain().'/,cn,106,106,1,M1156010');
        $this->assign('body_class', 'class-106');

        $info = D('article')->getArticleDetailById(1);
        $this->assign('info', $info);

        // SEO
        $this->assign('seo_title', '公司简介 - '.sysconf('seo_title'));
        $this->assign('seo_keywords', sysconf('seo_keywords'));
        $this->assign('seo_description', sysconf('seo_description'));

        return $this->fetch('');
    }

    public function contact()
    {
        $this->assign('generator', request()->domain().'/,cn,25,,7,M1156010');
        $this->assign('body_class', 'class-25');

        $info = D('article')->getArticleDetailById(2);
        $this->assign('info', $info);

        // SEO
        $this->assign('seo_title', '联系我们 - '.sysconf('seo_title'));
        $this->assign('seo_keywords', sysconf('seo_keywords'));
        $this->assign('seo_description', sysconf('seo_description'));

        return $this->fetch('');
    }






}
